package one;

import java.util.Date;


public class getMyTime {


   public static String getTime() {
       Date now=new Date();
       String ansString = getZero(now.getHours()) + ":" + getZero(now.getMinutes()) + ":"
               + getZero(now.getSeconds());
       return ansString;
   }

   public static String getZero(int a) {
       if(a < 10)
           return "0"+a;
       return ""+a;
   }

   public static String getDoTiming (String dotime) {

       int m = Integer.parseInt(dotime.substring(0, 2));
       int s = Integer.parseInt(dotime.substring(3, 5));
// System.out.println(m + "@@" + s);

       if(s == 0) {
           s=59;
           m -= 1;
       }else {
           s -= 1;
       }
       String mString = getZero(m);
       String sString = getZero(s);

       return mString + ":" + sString;
   }


}